*****Mikos, Robert A. and Cindy D. Kam
*****"Has the 'M' Word Been Framed?  Marijuana, Cannabis, and Public Opinion
*****Forthcoming, PLOS ONE
*****Version date: October 13, 2019

use "C:/users/kamcd/Dropbox/CDK WORK/drug labels/PLOS One submission/Replication files/MIKOS_KAM_PLOS_ONE.DTA", clear
cd "C:/users/kamcd/Dropbox/CDK WORK/drug labels/PLOS One submission/Replication files"
svyset [pw=weight]
set more off

//COVARIATES
*demographics
recode gender (1=0)(2=1)(else=.), gen(female)
gen age = 2017-birthyr
gen age01 = (age-18)/(91-18)
recode educ (1=0 "No HS")(2=.2)(3=.4)(4=.6)(5=.8)(6=1 "Postgrad")(else=.), gen(ed6cat)
recode race (1=0)(2 3=1)(else=.), gen(nonwhite)
recode inputstate (23 33 50 25 9 44 36 34 42=1 "Northeast")(10 24 51 54 37 45 13 21 47 28 2 12 5 22 40 48=2 "South")(38 46 31 20 27 19 29 55 17 18 26 39=3 "Midwest")(30 56 8 35 16 49 4 32 6 41 53=4 "West")(else=.), gen(region)
recode pid7 (1=1 "Str Dem")(2=.83)(3=.67)( 4 8 =.5)(5=.33)(6=.17)(7=0 "Str Rep")(else=.), gen(pid7cata)

//TABLE 1 DEMOGRAPHICS
svy: mean female age01 nonwhite 
svy: tab ed6cat 
svy: tab region
svy: tab pid7

//Treatment is van101_treat
gen expcond = van101_treat
lab def expcond 1"marijuana" 2"cannabis" 3"medmarijuana" 4"medcannabis", modify
lab val expcond expcond
recode van101_treat (1 3=1 "marijuana")(2 4=0 "cannabis")(else=.), gen(MJ)
recode van101_treat (1 3=0 "marijuana")(2 4=1 "cannabis")(else=.), gen(cannabis)
recode van101_treat (3 4=1)(1 2=0)(else=.), gen(medical)
recode van101_treat (3 4=0)(1 2=1)(else=.), gen(notmedical)
recode van101_treat (1=1 "marijuana")(2 3 4=0), gen(m_condition)
recode van101_treat (2=1 "cannabis")(1 3 4=0), gen(c_condition)
recode van101_treat (3=1 "medical marijuana")(1 2 4=0), gen(mm_condition)
recode van101_treat (4=1 "medical cannabis")(1 2 3 =0), gen(mc_condition)
gen MJmed = MJ*medical
gen cannmed = cannabis*medical

recode van101_treat (1=0 "marijuana")(2=1 "cannabis")(3 4 =.), gen(m_c)
recode van101_treat (1=0 "marijuana")(2=.)(3=1 "medical marijuana")(4=.), gen(m_mm)
recode van101_treat (1=0 "marijuana")(2=.)(3=.)(4=1 "medical cannabis"), gen(m_mc)
recode van101_treat (2=0 "cannabis")(1=.)(3=1 "medical marijuana")(4=.), gen(c_mm)
recode van101_treat (2=0 "cannabis")(1=.)(3=.)(4=1 "medical cannabis"), gen(c_mc)

*Balance tests
svy: mlogit MJ female age01 ed6cat nonwhite pid7cata i.region
svy, subpop(notmedical): mlogit MJ female age01 ed6cat nonwhite pid7cata i.region
svy, subpop(medical): mlogit MJ female age01 ed6cat nonwhite pid7cata i.region

*Legalization DV
recode VAN101 (1=1 "str legal")(2=.75)(3=.5)(4=.25)(5=0 "str not legal")(else=.), gen(legal)
recode VAN101 (1 2 4 5=0 "has opinion")(3=1 "DK/NOT sure")(else=.), gen(DKlegal)
svy: tab legal expcond, col

*Moral Acceptance DV
recode VAN102 (1=1 "OK")(2=.5)(3=0 "Wrong")(else=.), gen(moral)
recode VAN102 (1 3=0 "has opinion")(2=1 "DK/Not sure")(else=.), gen(DKmoral)
svy: tab moral expcond, col

*Tolerance of use 
recode VAN110 VAN111 VAN112 (1=0)(2=.33)(3=.67)(4=1)(else=.), gen(store_tol public_tol teacher_tol)
lab def tol 1"not at all" 0"a lot"
lab val store_tol public_tol teacher_tol tol 

svy: tab store expcond, col 
svy: tab public expcond, col 
svy: tab teacher expcond, col 

*harms: addictive, gateway, harm, driving
recode VAN221 VAN222 VAN223 VAN224 (1=1)(2=.75)(3=.5)(4=.25)(5=0)(else=.), gen(addictive gateway health driving)
lab def harms 0"not harmful" 1"harmful"
lab val addictive gateway health  driving harms
svy: tab addictive expcond, col
svy: tab gateway expcond, col
svy: tab health  expcond, col
svy: tab driving expcond, col

recode VAN221 VAN222 VAN223 VAN224 (1=0)(2=.25)(3=.5)(4=.75)(5=1)(else=.), gen(notaddictive notgateway nothealth notdriving)
lab def notharms 1"not harmful" 0"harmful"
lab val notaddictive notgateway nothealth notdriving notharms
recode VAN221 VAN222 VAN223 VAN224 (1 2 4 5=0)(3=1)(else=.), gen(addDK gatewayDK healthDK drivingDK)


//Table 3
foreach v of varlist legal moral store_tol public_tol teacher_tol notaddictive notgateway nothealth notdriving {
   svy: reg `v' cannabis cannmed medical
   est store `v'
} 

est table legal moral store_tol public_tol teacher_tol notaddictive notgateway nothealth notdriving, b(%9.2f) star(.1 .05 .01) stats(N) eq(1) 
est table legal moral store_tol public_tol teacher_tol notaddictive notgateway nothealth notdriving, b(%9.2f) se stats(N) eq(1)  style(col)


//Don't Know Analyses
svy: reg DKlegal cannabis cannmed medical
svy: reg DKmoral cannabis cannmed medical
svy: reg addDK cannabis cannmed medical
est store addDK 
svy: reg gatewayDK cannabis cannmed medical
est store gatewayDK 
svy: reg healthDK  cannabis cannmed medical
est store healthDK 
svy: reg drivingDK cannabis cannmed medical
est store drivingDK
est table addDK gatewayDK healthDK drivingDK, b(%9.2f) star(.1 .05 .01)  eq(1)

//characteristics of users
recode VAN241 VAN242 VAN243 VAN244 VAN245 VAN246 VAN247 VAN248 VAN249 VAN250 VAN251 VAN252 VAN253 VAN254 VAN255 (1=1)(2=.75)(3=.5)(4=.25)(5=0)(else=.) , gen(lazy hardworking healthy sick honest opportunistic teenaged elderly black latino white irresponsible dependable rich poor)
svy: mean lazy hardworking healthy sick honest opportunistic teenaged elderly black latino white irresponsible dependable rich poor
svy, subpop(m_condition): mean lazy hardworking healthy sick honest opportunistic teenaged elderly black latino white irresponsible dependable rich poor
matrix m_condition=e(b)'
svy, subpop(c_condition): mean lazy hardworking healthy sick honest opportunistic teenaged elderly black latino white irresponsible dependable rich poor
matrix c_condition=e(b)'
svy, subpop(mm_condition): mean lazy hardworking healthy sick honest opportunistic teenaged elderly black latino white irresponsible dependable rich poor
matrix mm_condition=e(b)'
svy, subpop(mc_condition): mean lazy hardworking healthy sick honest opportunistic teenaged elderly black latino white irresponsible dependable rich poor
matrix mc_condition=e(b)'

matrix means = (m_condition,c_condition,mm_condition,mc_condition)
matrix colnames means = marijuana cannabis medmarijuana medcannabis
matlist means, lines(col)


//individual traits
program MvCtraits
tempname memhold
postfile `memhold' b_cannabis se_cannabis using MvCtraits, replace
foreach v of varlist lazy irresponsible opportunistic hardworking dependable honest sick healthy teenaged elderly poor rich white black latino {
   svy: reg `v' cannabis cannmed medical
   est store `v'
post `memhold' (_b[cannabis]) (_se[cannabis])
} 
postclose `memhold'
end

MvCtraits

preserve
use MvCtraits, clear
gen DV = _n
lab def DV 1"Lazy" 2"Irresponsible" 3"Opportunistic" 4"Hardworking" 5"Dependable" 6"Honest" 7"Sick" 8"Healthy" 9"Teenaged"  10"Elderly" 11"Poor" 12"Rich" 13"White" 14"Black" 15"Latino"
lab val DV DV
gen LB = b_cannabis-1.96*se_cannabis
gen UB = b_cannabis+1.96*se_cannabis
lab var b "Marijuana vs. Cannabis"
lab var DV "DV"
sort b
list DV b
gen newDV =_n
lab def newDV 1"Rich" 2"Lazy" 3"Irresponsible" 4"Sick" 5"Healthy" 6"Teenaged" 7"Black" 8"White" 9"Poor" 10"Opportunistic" 11"Latino" 12"Hardworking" 13"Honest" 14"Elderly" 15"Dependable"
lab val newDV newDV
eclplot b LB UB newDV, horiz xline(0, lpattern(dash)) ylabel(1(1)15) xlabel(-.2(.1).2) scheme(s1mono) title("Marijuana vs. Cannabis") name(MvCtraits, replace) ytitle(" ")
restore

program medicaltraits
tempname memhold
postfile `memhold' b_medical se_medical using medicaltraits, replace
foreach v of varlist lazy irresponsible opportunistic hardworking dependable honest sick healthy teenaged elderly poor rich white black latino {
   svy: reg `v' medical 
   est store `v'
post `memhold' (_b[medical]) (_se[medical])
} 
postclose `memhold'
end
medicaltraits

preserve
use medicaltraits, clear
sum b_medical se_medical
gen DV = _n
lab def DV 1"Lazy" 2"Irresponsible" 3"Opportunistic" 4"Hardworking" 5"Dependable" 6"Honest" 7"Sick" 8"Healthy" 9"Teenaged"  10"Elderly" 11"Poor" 12"Rich" 13"White" 14"Black" 15"Latino"
lab val DV DV
gen LB = b_medical-1.96*se_medical
gen UB = b_medical+1.96*se_medical
lab var b "Use unspecified vs. Medical"
lab var DV "DV"
sort b
list DV b
gen newDV=_n
lab def newDV 1"Irresponsible" 2"Teenaged" 3"Lazy" 4"Poor" 5"Black" 6"Rich" 7"Healthy" 8"White" 9"Latino" 10"Opportunistic" 11"Dependable" 12"Hardworking" 13"Honest" 14"Elderly" 15"Sick"
lab val newDV newDV
eclplot b LB UB newDV, horiz xline(0, lpattern(dash)) ylabel(1(1)15) xlabel(-.2(.1).2) scheme(s1mono) title("Unspecified vs. Medical") name(medicaltraits, replace) ytitle(" ")
restore

*****Figure 5
graph combine MvCtraits medicaltraits, ycommon xcommon


*****Figure 6
//combining all of these policy and attitudinal Qs
preserve
program MvC
tempname memhold
postfile `memhold' b_cannabis se_cannabis using MvC, replace
foreach v of varlist legal moral store_tol public_tol teacher_tol notaddictive notgateway nothealth notdriving {
   svy: reg `v' cannabis cannmed medical
   est store `v'
post `memhold' (_b[cannabis]) (_se[cannabis])
} 
postclose `memhold'
end
MvC
restore

preserve
use MvC, clear
gen DV = _n
lab def DV 1"Legalize" 2"Moral Acceptance" 3"Store Opening" 4"Public Use" 5"Teacher Use" 6"Not Addictive" 7"Not Gateway" 8"Not Harmful to Health" 9"Does Not Impair Driving"
lab val DV DV

gen LB = b_cannabis -1.96*se_cannabis
gen UB = b_cannabis+1.96*se_cannabis
lab var b "Marijuana vs. Cannabis"
lab var DV "DV"
eclplot b LB UB DV, horiz xline(0, lpattern(dash)) ylabel(1(1)9) xlabel(-.2(.1).2) scheme(s1mono) title("Marijuana vs. Cannabis") name(MvC, replace)
restore

preserve
program medical
tempname memhold
postfile `memhold' b_medical se_medical using medical, replace
foreach v of varlist legal moral store_tol public_tol teacher_tol notaddictive notgateway nothealth notdriving {
   svy: reg `v' medical 
   est store `v'
post `memhold' (_b[medical]) (_se[medical])
} 
postclose `memhold'
end
medical
restore
preserve
use medical, clear
sum b_medical se_medical
gen DV = _n
lab def DV 1"Legalize" 2"Moral Acceptance" 3"Store Opening" 4"Public Use" 5"Teacher Use" 6"Not Addictive" 7"Not Gateway" 8"Not Harmful to Health" 9"Does Not Impair Driving"
lab val DV DV

gen LB = b_medical-1.96*se_medical
gen UB = b_medical+1.96*se_medical
lab var b "Use unspecified vs. Medical"
lab var DV "DV"
eclplot b LB UB DV, horiz xline(0, lpattern(dash)) ylabel(1(1)9) xlabel(-.2(.1).2) scheme(s1mono) title("Unspecified vs. Medical") name(medical, replace)
restore
graph combine MvC medical, ycommon xcommon


*Power analysis
sum legal if expcond==1
*Mean is .6 and sd is .38
*Small effect size (Cohen's d =.2) would be 0.075 shift
sampsi .6 .675, sd(.38) alpha(.05) power(.8)

*Combining across medical & nonmedical
sum legal if cannabis==0
*Mean is .64 and sd is .375
*Very small effect size (Cohen's d = .14)
sampsi .64 .6925, sd(.375) alpha(.05) power(.8)


